<template>
  <div class="table-page-search-wrapper">
    <el-form
      :model="searchForm"
      ref="searchForm"
      label-width="100px"
      class="demo-ruleForm"
    >
      <el-row>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="总订单编号:">
            <el-input
              v-model="searchForm.payOrderNo"
              placeholder="请输入订单号"
            />
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="订单编号:">
            <el-input
              v-model="searchForm.subOrderId"
              placeholder="请输入订单号"
            />
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="联系电话:">
            <el-input v-model="searchForm.phone" placeholder="请输入联系电话" />
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="订单状态:">
            <el-select
              v-model="searchForm.orderStatus"
              placeholder="请选择工单状态"
              style="width: 100%"
            >
              <el-option
                v-for="item in statuslist"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="创建时间:">
            <el-date-picker
              v-model="creatTime"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              @change="creatTimeChange"
              style="width: 100%"
              :default-time="['00:00:00', '23:59:59']"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="订单来源:">
            <el-select
              v-model="searchForm.orderSource"
              placeholder="请选择订单来源"
              style="width: 100%"
            >
              <el-option
                v-for="item in laiyuanList"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="门店:">
            <el-input
              v-model="searchForm.shopName"
              placeholder="请输入门店名称"
            />
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="配送方式:">
            <el-select
              v-model="searchForm.deliveryType"
              placeholder="请选择配送方式"
              style="width: 100%"
            >
              <el-option
                v-for="item in fangShilist"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <el-form-item label="取衣方式:">
            <el-select
              v-model="searchForm.pickupType"
              placeholder="请选择配送方式"
              style="width: 100%"
            >
              <el-option
                v-for="item in quYilist"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :md="8" :sm="12" :xs="24" style="padding: 0 8px">
          <div style="margin-left: 30px">
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="searchAction()"
              >查询</el-button
            >
            <el-button
              icon="el-icon-refresh"
              @click="resetSearch()"
              style="margin-left: 8px"
              >重置</el-button
            >
          </div>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
export default {
  name: "search",
  props: ["keyName"],
  data() {
    return {
      statuslist: [
        {
          label: "支付成功",
          value: "00",
        },
        {
          label: "支付失败",
          value: "01",
        },
        {
          label: "待支付",
          value: "02",
        },
        {
          label: "支付中",
          value: "03",
        },
        {
          label: "作废、关闭",
          value: "04",
        },
        {
          label: "退款中",
          value: "05",
        },
        {
          label: "退款完成",
          value: "06",
        },
        {
          label: "退款失败",
          value: "07",
        },
        {
          label: "退款待审核中",
          value: "08",
        },
      ], //订单状态
      laiyuanList: [
        {
          label: "线下",
          value: "02",
        },
        {
          label: "APP",
          value: "01",
        },
        {
          label: "小程序",
          value: "00",
        },
      ], //订单来源
      fangShilist: [
        {
          label: "上门取衣",
          value: "01",
        },
        {
          label: "到店",
          value: "02",
        },
      ], //配送方式
      quYilist: [
        //取衣方式
        {
          label: "上门配送",
          value: "01",
        },
        {
          label: "自提",
          value: "02",
        },
      ],
      searchForm: {},
      creatTime: [],
    };
  },
  methods: {
    searchAction() {
      //执行搜索
      this.$emit("search");
    },
    resetSearch() {
      this.searchForm = {};
      this.creatTime = [];
      this.$emit("resetSearch");
    },
    getSearchForm() {
      //获取高级搜索条件
      return {
        ...this.searchForm,
      };
    },
    creatTimeChange(e) {
      this.searchForm.beginTime = this.formDate(e[0]);
      this.searchForm.endTime = this.formDate(e[1]);
    },
  },
};
</script>


<style lang="less">
</style>>
